package kr.saeildamil.androidstudty.ch19;

import android.os.Handler;
import android.os.Message;

class BackThread extends Thread {
	int mBackValue=0;
	Handler mHandler;
	
	BackThread(Handler handler){
		mHandler=handler;
	}
	@Override
	public void run() {
		super.run();
		while (true) {
			mBackValue++;
			Message msg=new Message();
			msg.what=0;
			msg.arg1=mBackValue;
			mHandler.sendMessage(msg);
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
